package com.lrkj.payfee.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lrkj.common.annotation.Excel;
import com.lrkj.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 收款单明细对象 tb_receipt_detail
 *
 * @author yajun_ren
 * @date 2021-08-06
 */

@Data
public class ReceiptDetail extends BaseEntity implements Cloneable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String receiptDetailId;

    /**
     * 房屋id
     */
    @Excel(name = "房屋id")
    private String roomId;

    /**
     * 业主ID
     */
    @Excel(name = "业主ID")
    private String ownerId;

    /**
     * 收款单ID
     */
    @Excel(name = "收款单ID")
    private String receiptId;

    /**
     * 费用类型
     */
    @Excel(name = "费用类型")
    private String projectId;

    /**
     * 收费项目
     */
    @Excel(name = "收费项目")
    private String chargeId;

    /**
     * 收费标准
     */
    @Excel(name = "收费标准")
    private String normId;

    /**
     * 计费结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "计费结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date beginTime;

    /**
     * 计费结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "计费结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date finishTime;

    /**
     * 单价
     */
    @Excel(name = "单价")
    private BigDecimal prices;

    /**
     * 应收金额
     */
    @Excel(name = "应收金额")
    private BigDecimal receivableMoney;

    /**
     * 缴费周期
     */
    @Excel(name = "缴费周期")
    private String paymentCycle;

    /**
     * 冲抵金额
     */
    @Excel(name = "冲抵金额")
    private BigDecimal amountAmount;

    /**
     * 实收金额
     */
    @Excel(name = "实收金额")
    private BigDecimal billMoney;

    /**
     * 优惠金额
     */
    @Excel(name = "优惠金额")
    private BigDecimal specialMoney;

    /**
     * 优惠后金额
     */
    @Excel(name = "优惠后金额")
    private BigDecimal queenMoney;

    //收费单IDS
    private String ruleCostIds;

    //欠费金额
    private BigDecimal amountOwed;

    //收费标准名称
    private String normNames;

    //房屋名称
    private String roomName;

    //业主名称
    private String ownerName;

    //预收金额
    private BigDecimal preMoney;

    //费用单列表
    private List<RuleCost> ruleCosts;

    //状态
    private String status;
    //退款金额
    private BigDecimal drawbackMoney;
    //剩余可退金额
    private BigDecimal refundAmount;
    //结账期间
    private String fiscalPeriod;

    //转存金额
    private BigDecimal transferAmount;


    @Override
    public Object clone() {
        ReceiptDetail stu = null;
        try {
            stu = (ReceiptDetail) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return stu;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("receiptDetailId", getReceiptDetailId())
                .append("roomId", getRoomId())
                .append("ownerId", getOwnerId())
                .append("receiptId", getReceiptId())
                .append("projectId", getProjectId())
                .append("chargeId", getChargeId())
                .append("normId", getNormId())
                .append("beginTime", getBeginTime())
                .append("finishTime", getFinishTime())
                .append("prices", getPrices())
                .append("receivableMoney", getReceivableMoney())
                .append("paymentCycle", getPaymentCycle())
                .append("amountAmount", getAmountAmount())
                .append("billMoney", getBillMoney())
                .append("specialMoney", getSpecialMoney())
                .append("queenMoney", getQueenMoney())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
